FROM java:8

# zookeeper
ENV ZOOKEEPER_ADDR zookeeper://127.0.0.1:2181

# database
ENV MARIADB_JDBC jdbc:mariadb://127.0.0.1:3307/simple?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
ENV MARIADB_USER root
ENV MARIADB_PASS 811909

# server
ENV SERVER_PORT 8090

COPY target/simple-user-service.jar /opt

WORKDIR /opt

EXPOSE $SERVER_PORT

CMD ["/bin/bash", "-c", "\
java -jar simple-user-service.jar \
    --spring.profiles.active=pro \
    --server.port=$SERVER_PORT \
    --dubbo.registries.local.address=$ZOOKEEPER_ADDR \
    --spring.datasource.url=$MARIADB_JDBC \
    --spring.datasource.username=$MARIADB_USER \
    --spring.datasource.password=$MARIADB_PASS \
"]